/*
 * @Author: Jason Liu
 * @Date: 2025-06-03 14:51:26
 * @Desc: 
 */
const inteScheduleModule = require("./components/inteScheduleModule").default;
const $dataIntegration = require("w-vue-chongqing/src/api/dataIntegration");

export default {
  components: {
    inteScheduleModule
  },
  props: {
    show: {
      type: Boolean,
      default: false
    },
    inteScheduleInfo: {
      type: Object,
      default: () => {
        return {};
      }
    }
  },
  computed: {
    visible: {
      get() {
        return this.show;
      },
      set(val) {
        this.$emit('update:show', val);
      }
    }
  },
  watch: {
    visible(val) {
      if(val) {}
    }
  },
  data() {
    return {
      submitLoading: false,
    };
  },
  created() {},
  methods: {
    /**
     * @Author: y_zp
     * @description: 提交
     */
    toSave() {
      let jobTaskFlag = this.$refs.inteScheduleModule.toValidate();
      if(!jobTaskFlag) {
        return false;
      }
      let params = this.$refs.inteScheduleModule.toValidateData();
      this.submitLoading = true;
      $dataIntegration.saveScheduleTransfer(params).then(req => {
        this.$message.success("集成调度保存成功");
        this.visible = false;
        this.$emit("change");
      }).finally(() => {
        this.submitLoading = false;
      });

    },
    /**
     * @Author: y_zp
     * @description: 调试
     */
    toDebug() {
      this.$refs.inteScheduleModule.toDebug();
    },
    closeHandle() {
      this.visible = false;
    },
  }
};